/*--------------------------------------------------*/
/*VirtualSociety System ServiceModuleTemplate Class Body File*/
/*CreateBy SRPLab                */
/*CreateDate: 2011-3-29  */
/*--------------------------------------------------*/
#include "SRPSImgLibEngine_VSClass.h"
ClassOfSImgLibClass::ClassOfSImgLibClass()
{
}

ClassOfSImgLibClass::ClassOfSImgLibClass(class ClassOfSRPInterface *In_SRPInterface)
{
    if( In_SRPInterface == NULL )
        return;
    WrapObject(In_SRPInterface,VS_TRUE,VS_FALSE,In_SRPInterface -> MallocObjectL(&VSOBJID_SImgLibClass,0,NULL));
}

ClassOfSImgLibClass::ClassOfSImgLibClass(class ClassOfSRPInterface *In_SRPInterface,void *SRPObject)
{
    if( In_SRPInterface == NULL )
        return;
    WrapObject(In_SRPInterface,VS_FALSE,VS_FALSE,SRPObject);
}

VS_CHAR *ClassOfSImgLibClass::GetSelfName()
{
    static VS_CHAR Buf[64];
    strcpy( Buf, "SImgLibClass" );
    return Buf;
}

class ClassOfSImgLibClass *ClassOfSImgLibClass::GetSRPWrap( class ClassOfSRPInterface *In_SRPInterface,void *SRPObject,VS_ULONG In_ClassLayer)
{
    class ClassOfSImgLibClass *ClassObject;

    if( SRPObject == NULL || In_SRPInterface == NULL )
        return NULL;
    if( In_ClassLayer == 0xFFFFFFFF )
        In_ClassLayer = In_SRPInterface -> GetLayer( SRPObject );
    ClassObject = (class ClassOfSImgLibClass *)In_SRPInterface -> GetAppClass( SRPObject, In_ClassLayer );
    if( ClassObject != NULL && strcmp( ((class ClassOfSRPObject *)ClassObject) -> GetSelfName(), "SImgLibClass" ) == 0 )
        return ClassObject;
    ClassObject = new class ClassOfSImgLibClass();
    ClassObject -> WrapObject(In_SRPInterface,VS_FALSE,VS_TRUE,SRPObject, In_ClassLayer);
    return ClassObject;
}

VS_BOOL SRPAPI ClassOfSImgLibClass::C_DecodeImg(VS_BINBUFPTR InputBuf,VS_UINT32 * OutWidth,VS_UINT32 * OutHeight,VS_BINBUFPTR OutputBuf)
{
    SImgLibClass_C_DecodeImgProc LocalProc;

    LocalProc = (SImgLibClass_C_DecodeImgProc)ThisSRPInterface -> GetFunctionEx(ThisSRPObject,&VSFUNCID_SImgLibClass_C_DecodeImg);
    if( LocalProc != NULL )
        return LocalProc(ThisSRPObject,InputBuf,OutWidth,OutHeight,OutputBuf);
    else{
        VS_BOOL LocalReturnValue = VS_FALSE;

        return LocalReturnValue;
    }
}
VS_BOOL SRPAPI ClassOfSImgLibClass::C_CodeBMP(VS_UINT32 InWidth,VS_UINT32 InHeight,VS_BINBUFPTR InputBuf,VS_BINBUFPTR OutputBuf)
{
    SImgLibClass_C_CodeBMPProc LocalProc;

    LocalProc = (SImgLibClass_C_CodeBMPProc)ThisSRPInterface -> GetFunctionEx(ThisSRPObject,&VSFUNCID_SImgLibClass_C_CodeBMP);
    if( LocalProc != NULL )
        return LocalProc(ThisSRPObject,InWidth,InHeight,InputBuf,OutputBuf);
    else{
        VS_BOOL LocalReturnValue = VS_FALSE;

        return LocalReturnValue;
    }
}
VS_BOOL SRPAPI ClassOfSImgLibClass::C_CodeJPG(VS_UINT32 InWidth,VS_UINT32 InHeight,VS_BINBUFPTR InputBuf,VS_FLOAT Quality,VS_BINBUFPTR OutputBuf)
{
    SImgLibClass_C_CodeJPGProc LocalProc;

    LocalProc = (SImgLibClass_C_CodeJPGProc)ThisSRPInterface -> GetFunctionEx(ThisSRPObject,&VSFUNCID_SImgLibClass_C_CodeJPG);
    if( LocalProc != NULL )
        return LocalProc(ThisSRPObject,InWidth,InHeight,InputBuf,Quality,OutputBuf);
    else{
        VS_BOOL LocalReturnValue = VS_FALSE;

        return LocalReturnValue;
    }
}
VS_BOOL SRPAPI ClassOfSImgLibClass::C_CodePNG(VS_UINT32 InWidth,VS_UINT32 InHeight,VS_BINBUFPTR InputBuf,VS_BINBUFPTR OutputBuf)
{
    SImgLibClass_C_CodePNGProc LocalProc;

    LocalProc = (SImgLibClass_C_CodePNGProc)ThisSRPInterface -> GetFunctionEx(ThisSRPObject,&VSFUNCID_SImgLibClass_C_CodePNG);
    if( LocalProc != NULL )
        return LocalProc(ThisSRPObject,InWidth,InHeight,InputBuf,OutputBuf);
    else{
        VS_BOOL LocalReturnValue = VS_FALSE;

        return LocalReturnValue;
    }
}
VS_BOOL SRPAPI ClassOfSImgLibClass::C_DecodeGIF(VS_BINBUFPTR InputBuf,VS_UINT32 * OutWidth,VS_UINT32 * OutHeight,VS_BINBUFPTR OutputBuf,VS_UINT32 * FrameNumber,VS_PARAPKGPTR DelayTime)
{
    SImgLibClass_C_DecodeGIFProc LocalProc;

    LocalProc = (SImgLibClass_C_DecodeGIFProc)ThisSRPInterface -> GetFunctionEx(ThisSRPObject,&VSFUNCID_SImgLibClass_C_DecodeGIF);
    if( LocalProc != NULL )
        return LocalProc(ThisSRPObject,InputBuf,OutWidth,OutHeight,OutputBuf,FrameNumber,DelayTime);
    else{
        VS_BOOL LocalReturnValue = VS_FALSE;

        return LocalReturnValue;
    }
}

/*--------------------------------------------------*/
